#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+7;
int h[N], e[N], ne[N], idx;
int n;
void insert(int x) {
  int k = (x%N+N)%N;
  e[idx] = x;
  ne[idx] = h[k];
  h[k] = idx++;
}
bool find(int x) {
  int k = (x%N+N)%N;
  for(int i=h[k]; i!=-1; i = ne[i]) {
    if(e[i] == x) return true;
  }
  return false;
}
int main() {
  memset(h, -1, sizeof(h));
  cin>>n;
  string op;
  int x;
  while(n--) {
    cin>>op>>x;
    if("I"==op) {
      insert(x);
    }
    else {
      cout<<(find(x)?"Yes\n":"No\n");
    }
  }
}
